

#ifndef _READER_READER_HID_HF_H_
#define _READER_READER_HID_HF_H_

//HID 高频卡操作

#include "Reader.h"

int Reader_HID_HF_Init(void);
int Reader_HID_HF_PowerOnSE(void);
int Reader_HID_HF_SetupSE(void);

int Reader_HID_HF_GetPACBits(uint8_t pac[], uint8_t *len);
int Reader_HID_HF_ResetRF(void);
int Reader_HID_HF_CheckSE(void);

int Reader_HID_HF_ProcessAdminKey(void);
int Reader_HID_HF_ProcessConfigCard(void);

int Reader_HID_HF_GetECP(AppleWalletECParam_T* ecp);

int Reader_HID_HF_DoECP(void);

int Reader_HID_HF_IsJCOP(const uint8_t *ats);
/*----------------------------------------------------------------------------------------------------------*/
int Reader_HID_Seos_Select(uint8_t* fci, uint8_t* fciLen);

int Reader_HID_Seos_Authenticate(const uint8_t adf[], uint8_t adfLen, 
		const uint8_t privEncKeyOid[3], const uint8_t privMacKeyOid[3], const uint8_t authKeyOid[3]);

int Reader_HID_Seos_GetData(uint8_t tagLen, const uint8_t* tag, uint8_t readLen, uint8_t* readData, uint8_t* ilen);

int Reader_HID_Seos_PutData(uint8_t tagLen, const uint8_t* tag, uint8_t writeLen, const uint8_t* writeData);

enum AlgoID{
	DES2K = 2,
	DES3K = 4,
	SHA1 = 6,
	SHA256 = 7,
	AES128 = 9
};

int Reader_HID_Seos_GatherCardInfo(uint8_t* diversifier, uint8_t* diversifierLength, uint8_t* cipher, uint8_t* hash);

int Reader_HID_Seos_WritePrivacyKey(uint8_t cipher, const uint8_t* encKey, uint8_t elen, const uint8_t* macKey, uint8_t mlen);

int Reader_HID_Seos_ChangeAuthKey(uint8_t auth[16], const uint8_t* adf, uint8_t alen, 
	const uint8_t* diversifier, uint8_t diversifierLength, uint8_t cipher, uint8_t hash);

int Reader_HID_HF_CheckSeosCardType(void);
#endif


